/****************************************************************************
 * Copyright (C) 2025 Chenyz. All rights reserved.
 *
 * @file    TinyOS_Task.h
 *
 * @par     dependencies
 *          - stdint.h
 *
 * @author  Chenyz
 *
 * @brief   
 *
 * @version V1.0
 * @date    2025-09-4
 *
 * @note    
 ****************************************************************************/

#ifndef __TINYOS_TASK_H__
#define __TINYOS_TASK_H__

/******************************** Includes *********************************/
#include <stdint.h>
#include "TinyOS_Config.h"
#include "TinyOS_Lib.h"
#include "TinyOS_Types.h"
#include "TinyOS_Objects.h"
#include "TinyOS_Switch.h"

/*************************** Function Declarations **************************/
void TinyOS_TaskInit(
    TinyOS_TaskType* pTaskHandler, 
    void (*pfTaskFunc)(void *),
    void *pParam,
    uint8_t Priority,
    TinyOS_TaskStackType* pTaskStack,
	uint32_t TaskStackSize
);
void TinyOS_TaskScheduler(void);
void TinyOS_TaskSchedulerLockDisable(void);
void TinyOS_TaskSchedulerLockEnable(void);
void TinyOS_TaskSchedulerInit(void);
TinyOS_TaskType* TinyOS_HighestPriTaskReady(void);
void TinyOS_TaskSchedulerUnReady(TinyOS_TaskType* Task);
void TinyOS_TaskSchedulerReady(TinyOS_TaskType* Task);
void TinyOS_TaskResume(TinyOS_TaskType* Task);
void TinyOS_TaskSuspend(TinyOS_TaskType* Task); 
void TinyOS_TaskSchedulerDelete(TinyOS_TaskType* Task);
void TinyOS_TaskSchedulerDelete(TinyOS_TaskType* Task);
void TinyOS_TaskForceDelete(TinyOS_TaskType* Task);
void TinyOS_TaskDeleteRequest(TinyOS_TaskType* Task);
uint8_t TinyOS_TaskIsRequestedDelete(void);
void TinyOS_TaskDeleteSelf(void);
void TinyOS_TaskSetDeleteCallFunc(
    TinyOS_TaskType* Task,
    void(*DeleteFunc)(void * DeleteParam),
    void* DeleteParam
);
void TinyOS_TaskGetInfo(TinyOS_TaskType* Task, TinyOS_TaskInfo* TaskInfo);
	
#endif /* __TINYOS_TASK_H__ */

	
	
